<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import="com.Database.*" %>
<%@ page import="java.sql.*" %>
<%
   request.setCharacterEncoding("utf-8");
   String id = request.getParameter("id");
   conDB db = new conDB();
   db.connectDB();
   //Statement state = db.getConnection().createStatement();
   //String sql = "delete from personinfo where id = "+id;
   //int flag= state.executeUpdate(sql);
   String sql = "delete from personinfo where id = ?";
   PreparedStatement state = db.getConnection().prepareStatement(sql);
   state.setObject(1, id);
   int flag = state.executeUpdate();
   if(flag > 0)
   {
	   out.println("<script>alert('删除成功！');history.go(-1)</script>");
   }
   else
   {
	   out.println("<script>alert('删除失败！');history.go(-1)</script>");
   }
   state.close();
%>
